
using System.Collections.Generic;
using abilities.targets;
using UnityEngine;

namespace abilities
{

//造成伤害的数据
	public class HitData
	{
		public int DamageCapacity;

		// 攻击方
		public TargetObject Source;

		// 主要目标
		public TargetObject target;

		public int hitPoints;

		//AOE
		public float range;

		//首选目标
		public List<TargetObject> favoriteTargets;
		
		public Vector2 attackCenterPoint;

		public TargetUnitType TargetUnitType;
		
		public int additionalFinalHeight;
		private readonly DamageType damageType;
		private readonly TargetUnitSide _unitSide;

		public static HitData Create(TargetObject target, int hitPoints, float range, 
			DamageType damageType, TargetUnitSide unitSide, TargetUnitType targetUnitType, 
			Vector2   attackCenterPoint, int additionalFinalHeight)
		{
			return new HitData(target, hitPoints, range, damageType, unitSide, targetUnitType,
				attackCenterPoint, additionalFinalHeight);
		}

		HitData(TargetObject target, int hitPoints, float range, 
			DamageType damageType, TargetUnitSide unitSide, TargetUnitType targetUnitType, 
			Vector2   attackCenterPoint, int additionalFinalHeight)
		{
			this.hitPoints = hitPoints;
			this.range = range;
			this.damageType = damageType;
			this._unitSide = unitSide;
			this.target = target;
			this.TargetUnitType = targetUnitType;
			this.attackCenterPoint = attackCenterPoint;
			this.additionalFinalHeight = additionalFinalHeight;
			this.DamageCapacity = 0;
			this.Source = null;
		}
	}
}